//click_main_dlg.sqf
if (ACV_Filling_Dlg) exitWith {};
#include "ACV_Constantes.h"
#include "ACV_ID_main_dlg.h"
private ["_arr","_ctrl","_idx","_display",
"_cb_camp","_cb_faction","_cb_type","_cb_unit","_cb_type_grp","_cb_group",
"_cb_unitgrp","_cb_waypoint","_sl_skill","_sl_dir","_cb_empty","_cb_envol",
"_cb_objtype","_cb_mun","_cb_obj"];
disableSerialization;
_arr = _this select 0;
_ctrl = _arr select 0;
_idx  = _arr select 1;
_display 	= uiNamespace getVariable "R3F_ACV_MAIN_DLG";
_cb_camp	= _display displayCtrl ACV_DLG_ID_Main_CbCamp;
_cb_faction = _display displayCtrl ACV_DLG_ID_Main_CbFaction;
_cb_type	= _display displayCtrl ACV_DLG_ID_Main_CbType;
_cb_unit	= _display displayCtrl ACV_DLG_ID_Main_CbUnit;
_cb_typegrp = _display displayCtrl ACV_DLG_ID_Main_GrpCbTypeUnit;
_cb_group = _display displayCtrl ACV_DLG_ID_Main_GrpCbUnit;
_cb_unitgrp = _display displayCtrl ACV_DLG_ID_Main_GrpCbUnit;
_cb_waypoint = _display displayCtrl ACV_DLG_ID_Main_CbWayPoint;
_sl_skill = _display displayCtrl ACV_DLG_ID_Main_SliderSkill;
_sl_dir = _display displayCtrl ACV_DLG_ID_Main_SliderDir;
_cb_empty = _display displayCtrl ACV_DLG_ID_Main_ChkEmpty;
_cb_envol = _display displayCtrl ACV_DLG_ID_Main_EnVol;
_cb_objtype = _display displayCtrl ACV_DLG_ID_Main_CbObjtype;
_cb_mun = _display displayCtrl ACV_DLG_ID_Main_CbMun;
_cb_obj = _display displayCtrl ACV_DLG_ID_Main_CbObj;
if (_ctrl == _cb_camp) then {	
	ACV_Default_Side = _idx;
	ACV_Default_Faction = 0;
	ACV_Default_type = 0;
	ACV_Default_Unit = 0;
	ACV_Default_TypeGrp = 0;
	ACV_Default_Group = 0;
	[_cb_faction] call ACV_FNCT_FillFaction;
	[_cb_typegrp] call ACV_FNCT_FillTypeGrp;
	[_cb_group] call ACV_FNCT_FillGroup;
};
if (_ctrl == _cb_faction) then {
	ACV_Default_Faction = _idx;
	ACV_Sel_Faction = _cb_faction lbData _idx;
	ACV_Default_Type = 0;
	ACV_Default_Unit = 0;
	ACV_Default_TypeGrp = 0;
	ACV_Default_Group = 0;
	[_cb_type] call ACV_FNCT_FillType;
	[_cb_unit] call ACV_FNCT_FillUnit;
	[_cb_typegrp] call ACV_FNCT_FillTypeGrp;
	[_cb_group] call ACV_FNCT_FillGroup;
};
if (_ctrl == _cb_type) then {
	ACV_Default_Type = _idx;
	ACV_Default_Unit = 0;
	ACV_Default_TypeGrp = 0;
	ACV_Default_Group = 0;
	ACV_Sel_type = _cb_type lbData _idx;
	[_cb_typegroup] call ACV_FNCT_FillTypeGroup;
	[_cb_unit,_cb_group] call ACV_FNCT_FillUnit;
};
if (_ctrl == _cb_unit) then {
	ACV_Default_Unit = _idx;
};
if ( _ctrl == _sl_dir ) then {
	ACV_Default_Dir = (_idx * 10);
	[ _idx] call ACV_FNCT_SliderDirChange;
};
if ( _ctrl == _sl_skill ) then {
	ACV_Default_Skill = (_idx / 10);
};
if (_ctrl == _cb_empty) then {
	ACV_Default_Empty = _idx;
};
if (_ctrl == _cb_envol) then {
	ACV_Default_Envol = _idx;
};
if (_ctrl == _cb_typegrp) then {
	ACV_Default_TypeGrp = _idx;
	ACV_Sel_TypeGrp =  _cb_typegrp lbData _idx;
	[_cb_group] call ACV_FNCT_FillGroup;
};
if (_ctrl == _cb_group) then {
	ACV_Default_Group = _idx;
	ACV_Sel_Grp = "";
};
if (_ctrl == _cb_waypoint) then {
	ACV_Default_WayPoint = _idx;
};
if ( _ctrl == _cb_objtype ) then {
	ACV_Default_TypeObj = _idx;
	ACV_Default_Obj = 0;
	[_cb_obj] call ACV_FNCT_FillObj;
};
if (_ctrl == _cb_obj) then {
	ACV_Default_Obj = _idx;
};